package com.xufeng.demo.test;

import lombok.extern.slf4j.Slf4j;

import java.time.LocalDateTime;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * 使用函数式编程实现设计模式
 * 责任链模式
 *
 * @author xufeng
 * @since 21.07.2023
 */
@Slf4j
public class main4 {

    String text = "Text";


    public static void main(String[] args) {
        main4 m = new main4();
       List<String> strings= Stream.<Function<String, String>>of(String::toLowerCase, x ->
                       LocalDateTime.now().toString() + " " + x)
                .map(f -> f.apply(m.text)).collect(Collectors.toList());
       log.info(strings.toString());



    }


}
